'; window.popUpWin.document.write(zhtm); window.popUpWin.document.close(); // Johnny Jackson 4/28/98 } //--> Inside AutoCAD 14 -- Ch 22 -- Customizing Without Programming


Inside AutoCAD 14

Previous chapterNext chapterContents


- 22 -

Customizing Without Programming


by Michael Todd Peterson

One of AutoCAD's greatest assets is the degree to which this program can be personalized. AutoCAD can be customized by users with little or no programming knowledge, so it's a great tool for users of all skill levels.

Customizing AutoCAD to suit your needs is the best way to increase your productivity. If you can make AutoCAD work in a manner that facilitates your needs, you obviously will be more productive. In fact, AutoCAD is so easy to customize that, in a matter of hours, you can tailor this program to match your working environment.

This chapter focuses on how you can customize accessing commands. The chapter does not, however, discuss the process of adding new commands to AutoCAD. (Adding new commands is covered in Chapter 24, "Introduction to AutoLISP Programming.") In particular, this chapter covers the following topics:

Creating Keyboard Shortcuts

The most basic type of AutoCAD customization involves creating keyboard shortcuts, which are one- or two-key combinations that access an AutoCAD command. Keyboard shortcuts offer a powerful way to increase your productivity. For example, when you work with AutoCAD, one of your hands is almost always on the mouse or tablet puck. This leaves the other hand free for typing, so keyboard shortcuts can make accessing commands with your free hand very easy.

In AutoCAD, you can create a keyboard shortcut for any single-step command that can be accessed through the Command: prompt. For instance, you can create a keyboard shortcut for ZOOM, but you cannot create a shortcut for ZOOM WINDOW. This is because ZOOM WINDOW is initiated by accessing two separate commands. The only way you could create this type of keyboard shortcut would be to write a LISP (covered in Chapter 24, "Introduction to AutoLISP Programming") routine or to create a shortcut button on a toolbar.

In AutoCAD, all the keyboard shortcuts are contained in a text file, named the ACAD.PGP file. This file usually is located in the Support directory of your AutoCAD installation, regardless of whether you run the DOS or Windows version of AutoCAD. AutoCAD comes with a predefined ACAD.PGP that has some basic keyboard shortcuts that you may modify to suit your needs.

The process for creating a keyboard shortcut is very simple: modify the ACAD.PGP file and then reload it into AutoCAD. This process is explained in detail in the section that follows.

Modifying the ACAD.PGP File

In this section, you will learn how to modify the ACAD.PGP file to create your own keyboard shortcuts. The ACAD.PGP file should be located in your C:\ACADR14\ Support directory. To add your own custom keyboard shortcuts, you must modify the ACAD.PGP file. To modify the ACAD.PGP file, use any standard text editor, such as Notepad. After you load the file into the editor, you can begin to create your own keyboard shortcuts.


WARNING: As usual, before you make any changes to the ACAD.PGP file, make a backup copy of the original, in case something goes wrong.

Scroll down the ACAD.PGP file until you see the section starting with ";Command alias format:". The term alias is another name for a keyboard shortcut. To create an alias, type the shortcut or alias (the shortened command you will use instead of the full command), followed by the command that you want to use in the shortcut. The following code details part of the alias section of the ACAD.PGP.

;  Sample aliases for AutoCAD Commands
;  These examples include most frequently used commands. 3F,        *3DFACE
A,         *ARC
AL,        *ALIGN
AR,        *ARRAY
AAD,       *ASEADMIN
AEX,       *ASEEXPORT
ALI,       *ASELINKS
ASQ,       *ASESQLED
ARO,       *ASEROWS
ASE,       *ASESELECT
AT,        *DDATTDEF
ATE,       *DDATTE
B,         *BMAKE
BO,        *BOUNDARY
BR,        *BREAK
C,         *CIRCLE
CH,        *DDCHPROP
-CH,       *CHANGE

Notice that letter or symbol combinations act as shortcuts for their ensuing command. "A," for example, is the shortcut for the ARC command. Note also that each shortcut includes syntax containing a comma and an asterisk. You must include both of these characters in all alias commands.

If you scroll through the ACAD.PGP file, you can see all the predefined aliases or shortcuts that come with a standard AutoCAD installation. You can change any of these aliases to suit your needs or personal preference.


NOTE: If you use AutoCAD on a system with a small amount of RAM, limit your use of keyboard aliases to a minimum. Each keyboard alias takes up a small amount of memory, which reduces the total amount of memory available for your work.

After you add all your aliases to the ACAD.PGP file, save the file. The next time you load AutoCAD, the aliases will load automatically.

Changing Aliases within AutoCAD

Under some circumstances, you might want to change an alias without exiting AutoCAD. In this situation, you would follow these steps:

1. Start the standard Windows 95 or Windows NT Notepad text editor application.

2. Load the ACAD.PGP file from the C:\ACADR14\SUPPORT directory.

3. Make any necessary changes to the file, and save it.

4. Exit Notepad and return to AutoCAD.

5. When you enter AutoCAD again, you must re-initialize the ACAD.PGP file to activate the changes. To re-initialize the ACAD.PGP file, use the REINIT command by typing REINIT at the Command: prompt. A dialog box appears with options for the REINIT command, as shown in figure 22.1.

Figure 22.1 In the Re-initialization dialog box, you can update your keyboard shortcuts for the current session of AutoCAD.

Under the Device and File Initialization section of the dialog box, select the check box for the PGP File. Then click on OK. AutoCAD will reload the PGP file, and the new command aliases will be available.

As you can see, AutoCAD makes it easy to create as many simple keyboard shortcuts as you need to use the program effectively.

Customizing Windows Toolbars

In the Windows environment, you can use keyboard shortcuts and customizable toolbars to make your workspace work for you. A toolbar is a set of icons, each of which represents a specific AutoCAD command. You can customize the toolbars by creating icons of the AutoCAD commands that you use most often.

Creating your own toolbars offers several advantages. First, toolbars enable you to keep your eyes on the screen as you make use of them. If you use a tablet, for example, you would have to look away from the screen while accessing the tablet. Second, using both toolbars and keyboard shortcuts provides the greatest productivity gains from AutoCAD. You obtain the added productivity gains by using both methods because you may access the commands with whichever method is quickest under a particular circumstance. A little practice with using both and you will begin to see where you will use one over another. Figure 22.2 shows AutoCAD Release 14 and its Draw, Modify, Standard, and Object Properties command toolbars.

Figure 22.2 AutoCAD 14 contains four working toolbars: the Draw, Modify, Standard, and Object Properties command toolbars.

Modifying an Existing Toolbar

One of the most powerful advantages of AutoCAD 14 is that it enables you to modify toolbars. The following exercise demonstrates how to add a Polar Array icon to the Modify toolbar.

ADDING AN ICON TO A TOOLBAR

1. Load AutoCAD 14. In AutoCAD's default configuration, the Modify toolbar should be located on the left side of the screen.

2. Right-click on the corresponding button on the Modify toolbar to display the Toolbars dialog box (see fig. 22.3).

Figure 22.3 The Toolbars dialog box appears after you right-click on the Modify toolbar.

3. Make sure Modify is checked in the Toolbars list. Click on the Customize button to display the Customize Toolbars dialog box (see fig. 22.4).

Figure 22.4 The Customize Toolbars dialog box appears after you click on Customize in the Modify toolbar.

4. Select Modify from the Categories drop-down list. The Customize Toolbars dialog box appears, as shown in figure 22.5.

Figure 22.5 The Customize Toolbars dialog box can be accessed through the Modify toolbar.

5. In the Customize Toolbars dialog box, find the Polar Array button, which looks like a series of green circles arranged in a circle. Click and hold down the mouse button on this button. Drag and drop the button on the Modify toolbar to the location where you want the button to appear. The new Polar Array button appears on the toolbar, as shown in figure 22.6.

Figure 22.6 The Modify toolbar now contains the new Polar Array button.

6. Click on Close in the Customize Toolbars dialog box.

7. Click on Close in the Toolbars dialog box. AutoCAD menu files are automatically recompiled, and the changes are made permanent.

You have just customized the standard Modify toolbar and, in effect, have discovered how to add an icon to the toolbar. The following exercise shows you how to remove icons from a toolbar.


NOTE: In general, it is not a good idea to change the standard toolbars in AutoCAD. If you want to do a lot of customization, create and use your own toolbars. That way, if other users must use your system, they can still find and use the standard commands.

Imagine that you change the toolbar and then realize that you don't want a particular icon on the palette. The following steps demonstrate how to remove an icon from an existing toolbar.

REMOVING AN ICON FROM A TOOLBAR

1. Right-click on the Modify toolbar to display the Toolbars dialog box.

2. Click on the Customize button to access the Customize Properties dialog box.

3. Using the mouse, drag and drop the Polar Array icon off the Modify toolbar, but not on top of another toolbar. This removes the Polar Array icon from the toolbar.

4. Click on Close in the Customize Toolbars dialog box.

5. Click on Close in the Toolbars dialog box. The menus are now recompiled, and the icon is removed.


NOTE: Some icons in AutoCAD 14 have a small black triangle in the lower-right corner. This indicates that the icon is a flyout icon. If you click and hold on this type of icon, a flyout--a smaller toolbar--of other related command icons appears. You can add flyouts as a single icon to other toolbars in the same manner as adding individual command icons.

Creating Your Own Palettes

In AutoCAD, you can not only customize existing toolbars, but you also can create your own toolbars. You can place your new toolbar anywhere on the screen or even on other toolbars as a flyout. The following exercise demonstrates the steps used in this process.

You can start this exercise in one of two ways. You may choose whichever method you prefer.

CREATING CUSTOMIZED TOOLBARS

1. Right-click on any button on any toolbar, or choose View, Toolbars. The Toolbars dialog box appears, as shown previously in figure 22.3.

2. Click on the New button to display the New Toolbar dialog box (see fig. 22.7).

3. Type INSIDCAD in the Toolbar Name field. This is the name of your new toolbar.

4. Click on OK to create the toolbar. A blank toolbar appears at the top of the screen, as shown in figure 22.8.

Figure 22.7 You can name the new toolbar in the New Toolbar dialog box.

Figure 22.8 The new INSIDCAD toolbar appears at the top of the screen.


NOTE:[ENDD] The new toolbar might be hard to see because it appears on top of the existing Standard and Object Properties toolbars.

5. Move the new toolbar to the right side of the AutoCAD screen, as shown in figure 22.9.

Figure 22.9 Moving the INSIDCAD toolbar to a new position makes it easier to access.

6. Click on the Customize button in the Toolbars dialog box.

7. Add any command from any categories you want to the new toolbar. You can mix and match categories as well.


NOTE: When you create custom toolbars, you have the flexibility to add commands from any and all command categories. Feel free to mix and match commands, because you are not restricted to one category per toolbar.

8. Click on Close when you are finished customizing the toolbar. This saves the toolbar and recompiles the AutoCAD menus. Figure 22.10 shows a possible INSIDCAD toolbar configuration.

Figure 22.10 After customizing, the INSIDCAD toolbar could appear similar to this configuration.

Adding a Flyout to a Toolbar

Now that you have created your own toolbar, you might want to add this toolbar to the Modify toolbar as a flyout. The following exercise takes you through this process.

ADDING FLYOUT MENUS TO TOOLBARS

1. Right-click on the Modify toolbar to display the Toolbars dialog box.

2. Click on Customize to display the Customize Toolbars dialog box.

3. Click on the Categories drop-down list. Scroll down and select Custom to access the custom icons (see fig. 22.11).

Figure 22.11 The Customize Toolbars dialog box enables you to access the custom icons.


NOTE: AutoCAD 14 now has a Custom Flyout category of commands comprised of toolbars that are existing flyouts already created in AutoCAD. The INSIDCAD toolbar on which you are working does not appear in the list and must be created through the Custom category.

4. Drag and drop the flyout icon with the black triangle in the lower-right corner on the Modify toolbar. This adds a flyout icon to the Modify toolbar, as shown in figure 22.12.

Figure 22.12 The Modify toolbar now contains a blank flyout icon.

5. Right-click on the blank flyout icon on the Modify toolbar to display the Flyout Properties dialog box (see fig. 22.13).

Figure 22.13 The Flyout Properties dialog box is displayed by accessing the blank flyout icon.

6. Scroll down the Associated Toolbar list until you see the ACAD.INSIDCAD toolbar. Click on and highlight this toolbar so that you can assign it to the flyout.

7. Click in the Name field and type INSIDCAD to name the new toolbar.

8. In the Help field, type the following statement to give the flyout a help entry:

Assorted Commands Added as an Exercise

9. Click on Apply to apply the INSIDCAD toolbar to the flyout icon.

10. Close the Flyout Properties dialog box.

11. Click on Close in the Customize Toolbars dialog box.

12. Click on Close in the Toolbars dialog box to save the menu configuration. Figure 22.14 shows the final Modify tool palette configuration.

Figure 22.14 The final Modify toolbar is configured with the new flyout showing.


NOTE: As mentioned earlier in this chapter, it is not a good idea to customize the standard AutoCAD toolbars. For a little further practice, see if you can remove the flyout entry that you just created on the Modify toolbar.

The process of creating toolbars is quite simple in AutoCAD 14. Now that you know the steps, try to create a toolbar that contains the commands you use the most. Afterward, place your new toolbar in a convenient location on-screen.

Creating an Icon for a Non-Standard Command

Although the process of creating custom toolbars is straightforward, one problem still remains: not all AutoCAD commands have a toolbar icon for you to use. Additionally, some AutoCAD commands cannot support keyboard shortcuts because they require multiple entries at the Command: prompt. In these instances, you must create your own icon for the commands.

The following exercise shows you how to create a toolbar icon for an AutoCAD command that does not already have an icon on a toolbar. In this example, the REINIT command, discussed earlier, will be added to the INSIDCAD toolbar you created earlier in this chapter. If you have not completed the earlier exercises in this chapter, create your own custom toolbar for this exercise.


NOTE: The ^C^C in the Macro section of the Button Properties dialog box, which you will see in the following exercise, stands for pressing Esc twice in AutoCAD 14. If you press Esc twice, you can get out of any AutoCAD command. When you choose a button that has the ^C^C, it executes a double Esc and then executes the command that follows.

CREATING TOOLBAR ICONS FOR NON-STANDARD COMMANDS

1. Right-click on the INSIDCAD toolbar to display the Toolbars dialog box.

2. Click on Customize from the Toolbars dialog box to access the Customize Toolbars dialog box.

3. In the Categories drop-down list, select Custom to display the custom icons.

4. Drag and drop the blank button on the Modify toolbar. This adds an unassigned button to the palette.

5. Right-click on the blank button that you just dropped. The Button Properties dialog box appears, as shown in figure 22.15.

Figure 22.15In the Button Properties dialog box, you can create your own custom command buttons for toolbars.

6. In the Name field, type REINIT to name the button.

7. In the Macro Box, type REINIT after the ^C^C. The button will be associated with the REINIT command when you are finished.

8. In the Button Icon section of the dialog box, you can either choose an existing icon for the button or create your own. For this exercise, you will create your own. Click on the Edit button to display the Button Editor dialog box (see fig. 22.16).

Figure 22.16 The Button Editor dialog box enables you to choose or create your own icon for the new button.


NOTE:] In the Button Editor, you can use the drawing tool at the top of the dialog box to create custom icons. You also can click on the Open button to display a standard windows File Open dialog box. By selecting any BMP format graphic image, you can scale down the image and transfer it to the icon.
You should try to make your image as simple as possible. This will aid in making it as recognizable as possible. It is also suggested that any series of images that you draw follow a consistent pattern or look. This will make your customizations appear as professional as the standard AutoCAD icons.

9. Click on Save after you have created your icon.

10. Click on Close to return to the Button Properties dialog box.

11. Click on Apply to save your changes.

12. Close the Button Properties dialog box to return to the Customize Toolbars dialog box.

13. Click on Close, then Close again to save the changes in the menu file.

14. Place the cursor over the INSIDCAD toolbar and leave it there. The tooltip will eventually appear and confirm that this is the REINIT command, as shown in figure 22.17. Execute the command to verify that it works.

Figure 22.17 The tooltip verifies the REINIT command on the INSIDCAD toolbar.


NOTE: To add commands that require multiple entries at the command prompt, such as ZOOM WINDOW, separate each command with a semi-colon. For example, type 'zoom;w for this particular command. Note the use of the apostrophe, indicating that the command can be used transparently when chosen from the command button. If you forget the apostrophe, the command cannot be used transparently.

Furthermore, you also can add some simple LISP expressions to these buttons as well. Because this process involves a much more advanced use of these buttons, this book does not cover the steps. Consult the AutoCAD Customization Reference for more information on this particular feature.


The Windows version of AutoCAD 14 simplifies the process of creating your own icons. If you use a lot of custom commands in AutoCAD, you should create a toolbar and icons for those commands.

Customizing Menus

At some point, you will need to create your own custom menus in AutoCAD. To do this, you must modify the AutoCAD menu source file and then recompile the menu. This isn't as hard as it sounds, and customizing the menu enables you to create a menu structure that suits your working style. For example, if you created a bunch of AutoLISP routines for AutoCAD and did not want to take the time creating new buttons and icons for each, you could simply create a new pull-down menu for your LISP routines.

Before you begin, you first must understand how the menu items work. To take a closer look, load the ACAD.MNU file in the Support directory (usually C:\ACADR14\SUPPORT) into a text editor, such as Notepad.

The ACAD.MNU file is nothing more than a text file that is easy to modify and use to add features to your AutoCAD menu. Each pull-down menu in AutoCAD is referred to as a POP menu. POP0 is the pop-up menu that appears when you click the third mouse button on a three-button mouse, or when you press the Shift key and right-click with a two-button mouse. POP1 is the File menu. POP2 is the Edit menu, and so on. The following portion of ACAD.MNU lists entries for the Edit menu, or POP2.

***POP2
**EDIT
ID_MnEdit    [&Edit]
ID_Undo      [&Undo\tCtrl+Z]_u
ID_Redo      [&Redo\tCtrl+Y]^C^C_redo
             [--]
ID_Cutclip   [Cu&t\tCtrl+X]'_cutclip
ID_Copyclip  [&Copy\tCtrl+C]'_copyclip
ID_Copylink  [Copy &Link]^C^C_copylink
ID_Pasteclip [&Paste\tCtrl+V]'_pasteclip
ID_Pastesp   [Paste &Special...]^C^C_pastespec
ID_Erase     [Cle&ar\tDel]^C^C_erase
             [--]
ID_Links     [&OLE Links...]^C^C_olelinks

This code represents the Edit menu shown in figure 22.18.

Figure 22.18 The AutoCAD Edit menu is associated with the preceding MNU source code.

The first line of the source code, ***POP2, indicates the position of the pull-down menu. The third line, ID_MnEdit [&Edit], indicates the name of the menu. ID_MnEdit is a unique identifier for the name of the menu. Another occurrence of the word ID_MnEdit should not exist in the MNU file. The &Edit in brackets specifies the word that appears on the AutoCAD menu--in this case, Edit. The ampersand (&) in front of the E means that the E is underlined and can be accessed using the keyboard.


NOTE: Any line in the MNU file that begins with a \\ is a comment and is ignored by AutoCAD.

Following the menu definition is each command included on the Edit menu. The first command on the menu, the Undo command, can also be accessed through the keyboard by pressing Ctrl+Z. The MNU source entry indicates keyboard and menu access:

ID_Undo  [&Undo\tCtrl+Z]_u

ID_Undo is the identifier for this menu entry, and this entry must be unique. The brackets indicate the actual command name and the underlined character. The \t symbol stands for TAB to space the Ctrl+Z on the right side of the menu. Outside the bracket is the command you would enter at the Command: prompt in AutoCAD. For example, typing u at the Command: prompt activates Undo. Because this command is used in the menu file, it must have an underline before the command to make it execute correctly.


WARNING:[ENDD] When editing the MNU file, you must reload the menu to have any changes available. This, however, will delete any customized toolbar modifications you have made via the dialog box system. Be sure to copy your customization out of the MNS file into a temporary text file and transfer to the MNU during editing. That way your toolbar changes will not be lost.


TIP: The MNU file is a carry-over from the old menu system. This file is not required for AutoCAD menu customization, so you can delete the MNU file (or rename it) and edit the MNS instead. This enables you to save toolbar customization when editing your pull-down menu system. Any changes you make and any toolbar changes will be saved to the MNS file.

Creating Your Own Menu

The following exercise demonstrates how to create a new pull-down menu and add it to your existing AutoCAD menu. After you create the new menu, as shown in the following steps, recompile the menu and exit.

CREATING PULL-DOWN MENUS

1. Copy the ACAD.MNU file to MNU.BAK to make a backup file of the original.

2. Load ACAD.MNU into Notepad.

3. Scroll down the file until you see the section entitled ***Toolbars, which follows the POP10 entries.

4. Directly after the POP10 entries, add the following lines to the MNU file:

***POP11
**INSIDCAD
ID_MnINSIDCAD  [&INSIDCAD] 
ID_Reinit [&Reinit...]^C^C_reinit 
[--]	
ID_Extend [&Extend]^C^C_extend

5. Save the new MNU file.

6. In your AutoCAD support directory, delete the ACAD.MNS and ACAD.MNC files. This step deletes the original compiled menu and forces a recompile.

7. Now reload AutoCAD. The new pull-down menu appears after the Help menu.

Adding Commands to the Pop-Up Menu

The following exercise demonstrates how to add commands to the pop-up menu. Because the pop-up menu is accessed through a combination Shift+right-click on the screen, it is very convenient. You can place any commands that you use frequently on this menu; for example, the LINE command would make good sense on this menu.

ADDING COMMANDS TO POP-UP MENUS

1. Load ACAD.MNU file into Notepad.

2. Find the entry marked ***POP0, and then look for the following entry:

[Endpoint]_endp

3. Above this line, type the following entry:

[Line]_line

This new line adds the LINE command to the menu.

4. Save the file.

5. Delete the ACAD.MNC and ACAD.MNS files from the AutoCAD support directory. This step forces AutoCAD to recompile the menu files.

6. Reload AutoCAD. This recompiles the menus and causes the new pop-up menu to appear.

If you get a little confused while trying to add a new menu, take a few minutes and look over the MNU file for some examples of a menu that has already been done. If all else fails, consult the AutoCAD customization guide for help on customizing the AutoCAD menus.

Summary

This chapter introduced you to many benefits of customizing AutoCAD. Throughout this chapter, you saw how easy it is to create your own toolbars, add your own menus, create your own icons, and even specify where you want AutoCAD to place toolbars when it loads.

After you customize AutoCAD so that it is easier to access the commands that you use most, you almost immediately will begin to see a rise in productivity.


Previous chapterNext chapterContents

© Copyright, Macmillan Computer Publishing. All rights reserved.